Conversation
and results
pism_terra/raster.py: introduce local_scale_factor(crs, x, y) that returns
the dimensionless local scale factor k such that 1 m of true ground
displacement at (x, y) equals k m of crs map units.
- Computes sqrt(|det J|) of the true→map Jacobian via a numerical
finite difference of pyproj's geographic→crs transform.
- Uses the source ellipsoid's prime-vertical N(φ) and meridional M(φ)
radii of curvature to convert the geographic step to true metres,
instead of a hardcoded 6378137 m (correct on non-WGS-84 datums too).
- Vectorised on numpy arrays; scalar in → float out.
Motivation: glacier_velocities_from_grid does a finite-difference
advect-and-roundtrip to rotate vx/vy into the destination CRS axes,
which silently assumes the source CRS has unit local scale. That holds
for the ITS_LIVE v2.1 per-region polar-stereographic COGs but fails for
EPSG:3857 (Web Mercator), where k = 1/cos(φ) ≈ 2 at 60° N and the
returned vx/vy come out halved. Pre-multiplying vx_pts/vy_pts by k
ahead of the FD makes the round-trip CRS-agnostic.
The docstring documents the math (with the M, N, det J formulae),
explains the conformal-vs-non-conformal behaviour, and ships three
doctest examples covering Mercator at 60° N, polar-stereo near its
true-scale latitude, and the array call signature.
Single-line subject if you prefer the terse style:
raster: add local_scale_factor for CRS-agnostic vector transforms
…a into aaschwanden/summer-school
Aaschwanden/summer school
…ra into aaschwanden/summer-school
…ra into aaschwanden/summer-school
impi renamed to iimpi. Uff.
…ra into aaschwanden/summer-school
…ra into aaschwanden/summer-school
get resolution from config.
…a into aaschwanden/summer-school
Split each ISMIP7 product scalar file into per-variable diagnostics
(lim, limnsw, iareagr/fl, tend*) via a packaged NCO script run at the end
of the generated forward job script.
- data/postprocess_ismip7_scalar.sh: NCO script (fix global attrs + time
units; extract each diagnostic to float with _FillValue; correct flux
units/time). Uses a per-input scratch file so concurrent sweep jobs
don't collide on a shared tmp.nc.
- run.py: post_scalar_str runs the script on the product-leg scalar --
scalar_hist for historical experiments (C001/C002), scalar_proj for the
projection experiments, both for legacy non-counter runs.
- templates: add {{ post_scalar_str }} to the ISMIP7 forward templates
(and the missing compliance-checker block to chinook-ismip7.j2).
- pyproject: ship data/*.sh in package-data.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014DGQGDhsstkb1faoVUwh4M
Aaschwanden/ismip7 gris
hilljessica8787-dot
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.